Skip to content

feat: add ability to delete all instruction steps - #1599

Draft
maxelkins wants to merge 4 commits into
mainfrom
remove-all-instruction-steps
Draft

feat: add ability to delete all instruction steps#1599
maxelkins wants to merge 4 commits into
mainfrom
remove-all-instruction-steps

Conversation

@maxelkins

@maxelkins maxelkins commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

🤖 Created with AI assistance
👨‍💻 Heavily edited, reviewed and steered by @maxelkins

Summary

Teachers editing instructions can now remove every step at once, not just the step they are on. The remove confirmation modal offers a choice of scope, defaulting to the current step so that clearing everything is always a deliberate selection.

Fixes https://github.com/RaspberryPiFoundation/digital-editor-issues/issues/1705

Changes

  • Add a scope choice to the remove instructions modal, using the design system Fieldset and RadioInput components
  • Default the choice to removing the current step every time the modal opens, and changes the confirm button text depending on the selected outcome
  • Hide the choice when there is only one step, where the button reads "Remove instructions"
  • Rewrite the modal copy so it reads correctly whichever scope is chosen
  • Scope the modal input styles to text inputs so they no longer override design system form controls, including their focus outlines
  • Allow a className to be passed through GeneralModal

Screenshots

Screenshot.2026-08-14.at.17.18.05.mp4

@maxelkins
maxelkins temporarily deployed to previews/1599/merge August 14, 2026 16:00 — with GitHub Actions Inactive
@maxelkins

Copy link
Copy Markdown
Contributor Author

Bold radio text is incorrect (shows in standalone) another symptom of react portals moving outside shadow dom.

https://github.com/RaspberryPiFoundation/digital-editor-issues/issues/1716

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds deliberate scope selection when removing instruction steps.

Changes:

  • Supports removing the current step or all steps.
  • Updates modal copy, controls, styling, and translations.
  • Adds tests for scope selection and removal behavior.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/utils/instructionSteps.js Defines removal scope constants.
src/components/Modals/RemoveInstructionStepModal.jsx Adds scope radio controls.
src/components/Modals/GeneralModal.jsx Supports custom modal classes.
src/components/Menus/Sidebar/InstructionsPanel/InstructionsPanel.jsx Implements scoped removal behavior.
src/components/Menus/Sidebar/InstructionsPanel/InstructionsPanel.test.jsx Tests removal scopes and defaults.
src/assets/stylesheets/Modal.scss Limits input styling to text inputs.
src/assets/stylesheets/Instructions.scss Styles the removal modal.
public/translations/en.json Adds updated removal copy.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@jamiebenstead jamiebenstead left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@maxelkins
maxelkins marked this pull request as draft August 18, 2026 08:54
@maxelkins
maxelkins temporarily deployed to previews/1599/merge August 18, 2026 08:54 — with GitHub Actions Inactive
@maxelkins
maxelkins force-pushed the remove-all-instruction-steps branch from 538bf45 to 2be0d17 Compare August 18, 2026 08:58
@maxelkins
maxelkins temporarily deployed to previews/1599/merge August 18, 2026 08:58 — with GitHub Actions Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants